//
//  NSData+Friend.h
//  
//
//  Created by lwx376629 on 16/11/1.
//  Copyright © 2016年 Capfer. All rights reserved.
//

#import <Foundation/Foundation.h>
@class TYZModel;
@interface NSData (Friend)
/**
 *  NSData类型转NSInteger类型
 */
- (NSInteger)integerValue;
/**
 *  NSData类型二进制的数字字符串
 */
- (NSString *)dataToHex2String;

- (int64_t)integerValueWithSign;

+ (uint16_t)NSDataToInt16ByBigEndian:(NSData *)data;

+ (uint16_t)NSDataToInt16ByLittleEndian:(NSData *)data;

/**
 * 将Data大端解析为整数
 */
+ (int64_t)NSDataToIntByBigEndian:(NSData *)data isSigned:(BOOL)isSigned;

/**
 * 将Data小端解析为整数
 */
+ (int64_t)NSDataToIntByLittleEndian:(NSData *)data isSigned:(BOOL)isSigned;
/**
 * 获得MD5字符串
 */
- (NSString*)MD5;
/**
 * 模型的反序列化
 */
- (TYZModel *)model;
@end
